home *** CD-ROM | disk | FTP | other *** search
/ SGI Enlighten DSM 1.1 / SGI EnlightenDSM 1.1.iso / dec3240 / install.z / install / bin / show_enl_daemons < prev    next >
Text File  |  1998-06-30  |  1KB  |  64 lines

  1. #!/bin/sh
  2. #
  3. # Script: show_enl_daemons
  4. #
  5. # show_enl_daemons shows Enlighten daemons that are running and their PIDs.
  6. # (md, pep, renld, and Events)
  7. #
  8. # Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
  9. # All Rights Reserved.
  10. #
  11. # (ksh was used to bypass a variable bug in SCO3's sh. This script
  12. #  is /bin/sh compatible.)
  13. #
  14.  
  15. SHUTDOWN_SECS=10
  16.  
  17. PATH=/bin:/usr/bin:/etc:/usr/ucb:/usr/bsd:/usr/etc:$PATH
  18. export PATH
  19.  
  20. appName=`basename $0`
  21.  
  22. errorCheck () {
  23.     if [ $? -ne 0 ] ; then
  24.         echo "$appName: Fatal: Could not stop Enlighten daemons." 1>&2
  25.         exit 1
  26.     fi
  27. }
  28.  
  29. OS=`uname -s`
  30. REV=`uname -r`
  31.  
  32. #
  33. # Deal with bsd ps
  34. #
  35.  
  36. OPTS="-e"
  37. PIDCOLUMN=1
  38.  
  39. if [ "$OS" = "SunOS" ]; then
  40.     case "$REV" in
  41.         4.1.* )
  42.             OPTS="-gxww"
  43.             PIDCOLUMN=1
  44.             ;;
  45.     esac
  46. fi
  47.  
  48. PIDS=`ps $OPTS | egrep -e 'emdd|pep|AgentMon|AgentENL|emdd|renld' | grep -v egrep`
  49.  
  50. if [ -z "$PIDS" ] ; then
  51.     echo
  52.     echo "No Enlighten daemons are running."
  53.     echo
  54. else
  55.     echo
  56.     echo "The following Enlighten daemons are running:"
  57.     echo
  58.     ps $OPTS | grep PID | grep -v grep
  59.     echo "$PIDS"
  60.     echo
  61. fi
  62.  
  63. exit 0
  64.